package com.apes.hr.paySupport.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.hr.base.model.Employee;
import com.apes.hr.paySupport.model.SupportApplicationItem;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @Title: SupportApplicationItem
 * @Description:付费支援申请单（支援人员明细）
 * @author: ZhengZeXian
 * @create: 2021/4/15 10:09
 */
public interface SupportApplicationItemRepository extends CustomRepository<SupportApplicationItem,String> {

    @Modifying
    @Query(value = "UPDATE hr_support_application_item SET ROLE_LIST =?1 WHERE ID = ?2", nativeQuery = true)
    void updateItemRoles(String roleList, String itemId);

    @Modifying
    @Query("UPDATE SupportApplicationItem SET iconExecute = ?2 WHERE id = ?1")
    void updateItemIconExecute(String id, boolean iconExecute);

    List<SupportApplicationItem> findAllById(String id);

    List<SupportApplicationItem> findBySupportUidAndIconExecuteAndRepeal(Employee employee,boolean exec,Boolean repeal);
}


